# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-frameworks
pkgname=kcrash5
pkgver=5.113.0
pkgrel=0
pkgdesc="Support for application crash analysis and bug report from apps"
arch="all !armhf"
url="https://community.kde.org/Frameworks"
license="LGPL-2.1-or-later"
depends_dev="
	kcoreaddons5-dev
	kwindowsystem5-dev
	"
makedepends="$depends_dev
	doxygen
	extra-cmake-modules
	qt5-qttools-dev
	samurai
	"
checkdepends="xvfb-run"
_repo_url="https://invent.kde.org/frameworks/kcrash.git"
source="https://download.kde.org/stable/frameworks/${pkgver%.*}/kcrash-$pkgver.tar.xz"
subpackages="$pkgname-dev $pkgname-doc"
builddir="$srcdir/kcrash-$pkgver"

replaces="kcrash<=5.110.0-r0"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_QCH=ON
	cmake --build build
}

check() {
	# kcrashtest is broken
	xvfb-run ctest --test-dir build --output-on-failure -E "kcrashtest"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
e0076f05ec39ae6fc7dac35b39438a37b2201e2b96a98684c7221aaa65be741bdfd982e669fbed312bb35fa8cf964575d40c4013796053f1b1b31117dcc79c41  kcrash-5.113.0.tar.xz
"
